﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayerInforPage : EventManager {


    //0 头像 1 name 2 id  3 ip
    public override void InformationSetting()
    {
//        SetText(this.BindingSource[1], GameData.GetInstance().userName);
//        SetText(this.BindingSource[2], GameData.GetInstance().userID);
//        SetText(this.BindingSource[3], GameData.GetInstance().userIP);
//        if (GameData.GetInstance().place == null || GameData.GetInstance().place.Equals(""))
//        {
//            SetText(this.BindingSource[4], "未知");
//        }
//        else
//        {
//            SetText(this.BindingSource[4], GameData.GetInstance().place.ToString());
//        }
//        Debug.Log("地理位置1" + GameData.GetInstance().place);
//#if UNITY_ANDROID
//#elif UNITY_IPHONE
//#endif
//        string url = GameData.GetInstance().avatar;  
//        if (GameHallPage.headTexture2D!=null )
//        {
//            this.BindingSource[0].GetComponent<RawImage>().texture = GameHallPage.headTexture2D;
//        }
//        else if ( url != null )
//        {
//            url = url.Substring(0, url.Length - 1);
//            url += "132";
//            if (url != null)
//            {
//                StartCoroutine(DownloadImage(url));
//            }
//        }
    }
    private IEnumerator DownloadImage(string url)
    {
        WWW www = new WWW(url);
        yield return www;
        this.BindingSource[0].GetComponent<RawImage>().texture = www.texture;
    }

    void ClosePage()
    {
        Destroy(this.gameObject);
    }
}
